An iterator of the columns of the array.
float[][] nums = [[1.0f, 2.0f], [10.0f, 20.0f]] assert nums.transpose() == nums.columns().toList()
Flattens a 2D array into a new collection. The items are copied row by row.
Example usage:
float[][] array = [[0.0f, 1.0f], [2.0f, 3.0f]] assert array.flatten() == [0.0f, 1.0f, 2.0f, 3.0f]
A transpose method for 2D float arrays.
Example usage:
float[][] floats = [[1.0f, 10.0f], [2.0f, 20.0f]] float[][] expected = [[1.0f, 2.0f], [10.0f, 20.0f]] def result = floats.transpose() assert result == expected assert floats.class.componentType == result.class.componentType